const mongoose = require('mongoose');

const cameraSchema = new mongoose.Schema({
    name: { type: String, required: true, unique: true },
    host: { type: String, required: true },
    port: { type: Number, default: 80 },
    username: { type: String, default: 'admin' },
    password: { type: String, required: true },
    location: { type: String, default: '未知' },
    // users: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
}, { timestamps: true });

module.exports = mongoose.model('Camera', cameraSchema, 'camera');
